﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Apps.Model.Base;

namespace Apps.Model.Models
{
    /// <summary>
    /// 角色表
    /// </summary>
    [Table("Sys_Role")]
    [Description("角色表")]
    public class SysRole : SysBase, IEntity<int>
    {
        /// <summary>
        /// 主键
        /// </summary>
        [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
        public int Id { get; set; }

        /// <summary>
        /// 角色编码
        /// </summary>
        [Required]
        public string RoleCode { get; set; }

        /// <summary>
        /// 角色名称
        /// </summary>
        [StringLength(50)]
        public string RoleName { get; set; } 

        /// <summary>
        /// 状态
        /// </summary>
        public int IsEnable { get; set; } = 1;

        /// <summary>
        /// 是否删除
        /// </summary>
        public int? IsDeleted { get; set; } = 0;

        /// <summary>
        /// 描述
        /// </summary>
        [StringLength(200)]
        public string? Description { get; set; }



        //[NotMapped]
        //// 导航属性
        //public ICollection<UserRole> UserRoles { get; set; }
        //public ICollection<RolePermission> RolePermissions { get; set; }
    }
}
